﻿using System;
using System.Linq;


class CalculatesWorkDays
{
    static int CalculateWorkingDays(DateTime lastWorkDate, DateTime[] holidays)
    {
        DateTime currentDate = DateTime.Now;
        Array.Sort(holidays);

        var workDays = 0;
        for (var date = currentDate; date < lastWorkDate; date = date.AddDays(1))
        {
            if (date.DayOfWeek != DayOfWeek.Saturday
                && date.DayOfWeek != DayOfWeek.Sunday
                && Array.BinarySearch(holidays, date)<0)
                workDays++;
        }

        return workDays;
    }


    static void Main()
    {
        Console.Write("Enter date (MM/DD/YYYY): ");
        DateTime inputDate = Convert.ToDateTime(Console.ReadLine());

        Console.Write("How many holidays do we have? ");

        DateTime[] vacantions;
        int vacationsLength = int.Parse(Console.ReadLine());

        vacantions = new DateTime[vacationsLength];
            
        Console.WriteLine("now enter the dates (dd)");
        for (int counter = 0; counter < vacantions.Length; counter++)
        {
            vacantions[counter] = Convert.ToDateTime(Console.ReadLine());
        }

        Console.WriteLine("from {0} to {1} there are {2} work days",DateTime.Now, inputDate, CalculateWorkingDays(inputDate, vacantions));
        
    }
}
